 function getQueryString(name) {
 	var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
 	var r = window.location.search.substr(1).match(reg);
 	if (r != null) return unescape(r[2]);
 	return null;
 }

 var page = getQueryString("page");
 var pagelist = ['test', 'test2'];

 var isrouter = 0;
 for (var i = 0; i < pagelist.length; i++) {
 	 	if(pagelist[i] == page){
 	 		isrouter =1;
 	 		break;
 	 	}

 	}
if(isrouter == 0){
	page = 404;
}

 var config = {
 	host:"http://location:8088/git/mvc/",
 	titleset:function(title){
 		$("title").html(title);
 	}
 } 


 var head = document.getElementsByTagName('head')[0];
 var js = document.createElement("script");
 js.type = "text/javascript";
 js.src = "controller/" + page + "/index.js";

 head.appendChild(js);